package DomainLayer;

import Annotations.ProcessNameAnnotation;
import org.apache.log4j.varia.StringMatchFilter;

@ProcessNameAnnotation(Name="UserStateChange")
public class UserStateChangeProcess extends AbstractProcess
{
	private UserEntity user;
	private boolean banStatus;
    private String lastIP;
    private String sessionId;

	public void setBanStatus(boolean banStatus) {
		this.banStatus = banStatus;
	}

    public void setLastIP(String lastIP)
    {
        this.lastIP = lastIP;
    }

    public void setSessionID(String sessionId)
    {
        this.sessionId = sessionId;
    }

	public UserEntity getUser() 
	{
		return user;
	}
	public void setUser(UserEntity user) 
	{
		this.user = user;
	}

	@Override
	public void process() 
	{
		super.process();
		setStatus(ProcessStatus.InProcess);
		getUser().setUserState(new UserStateValueObject(getUser().getUserState(), banStatus, sessionId, lastIP));
		setStatus(ProcessStatus.Completed);
	}
}
